package com.itheima.Jiuye14;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
    private ArrayBlockingQueue arr;
    public Cooker(ArrayBlockingQueue arr) {
        this.arr = arr;
    }

    @Override
    public void run() {
        while (true) {
            try {
                Object take = arr.take();
                System.out.println("吃货拿出了"+take+"吃掉了");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
      //  super.run();
    }
}
